﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:replace="comm/comm::company-head"></head>
<body>
    <div id="wrapper">
        <nav class="navbar navbar-default top-navbar" role="navigation">
            <div th:replace="comm/comm::company-top"></div>
        </nav>
        <!--/. NAV TOP  -->
        <!--/. NAV TOP  -->
        <nav class="navbar-default navbar-side" role="navigation">
            <div th:replace="comm/comm::company-left"></div>
        </nav>
        <!-- /. NAV SIDE  -->
        <div id="page-wrapper" >
            <div id="page-inner">
			 <div class="row">
                    <div class="col-md-12">
                        <h1 class="page-header">
                            添加职位 <small>add Position.</small>
                        </h1>
                    </div>
                </div> 
                 <!-- /. ROW  -->
              <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            职位信息
                        </div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-lg-6">
                                        <div class="form-group">
                                            <label>职位名</label>
                                            <input class="form-control" v-model="title" placeholder="职位名">
                                        </div>
                                        <div class="form-group">
                                            <label>要求</label>
                                            <textarea class="form-control" v-model="intro"  rows="3"></textarea>
                                        </div>
                                        <div class="form-group">
                                            <label>薪资</label>
                                            <div class="form-group input-group">
                                                <span class="input-group-addon">$</span>
                                                <input type="text" v-model="money" class="form-control">
                                                <span class="input-group-addon">.00</span>
                                            </div>
                                        </div>
                                        <button class="btn btn-default" @click="addPosition">保存</button>
<!--                                        <button type="reset" class="btn btn-default">重置</button>-->
                                </div>
                            </div>
                            <!-- /.row (nested) -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
			<footer><p>@管理控制台</p></footer>
			</div>
             <!-- /. PAGE INNER  -->
            </div>
         <!-- /. PAGE WRAPPER  -->
        </div>
     <!-- /. WRAPPER  -->
    <!-- jQuery Js -->
    <script src="/static/js/jquery-1.10.2.js"></script>
    <!-- Bootstrap Js -->
    <script src="/static/js/bootstrap.min.js"></script>
    <!-- Metis Menu Js -->
    <script src="/static/js/jquery.metisMenu.js"></script>
    <!-- Custom Js -->
    <script src="/static/js/custom-scripts.js"></script>
    <script>
        let vm = new Vue({
            el:'#page-wrapper',
            data:{
                title:'',
                money:'',
                intro:''
            },
            methods:{
                addPosition(){
                    let formData = new FormData()
                    formData.append('title',this.title)
                    formData.append('money',this.money)
                    formData.append('intro',this.intro)
                    axios.post('/position/add',formData).then(res=>{
                        if (res.data){
                            alert('职位添加成功')
                        }
                    })
                }
            },
            mounted(){
                console.log('vue start')
            }
        })
    </script>
   
</body>
</html>
